package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the JOBSECURITY database table.
 * 
 */
@Embeddable
public class JobsecurityPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String jobclass;
	private String groupname;

    public JobsecurityPK() {
    }

	@Column(unique=true, nullable=false, length=130)
	public String getJobclass() {
		return this.jobclass;
	}
	public void setJobclass(String jobclass) {
		this.jobclass = jobclass;
	}

	@Column(unique=true, nullable=false, length=10)
	public String getGroupname() {
		return this.groupname;
	}
	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof JobsecurityPK)) {
			return false;
		}
		JobsecurityPK castOther = (JobsecurityPK)other;
		return 
			this.jobclass.equals(castOther.jobclass)
			&& this.groupname.equals(castOther.groupname);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.jobclass.hashCode();
		hash = hash * prime + this.groupname.hashCode();
		
		return hash;
    }
}